<?php
/**
 * @var $product array
 */
use yii\helpers\ArrayHelper;
use app\common\helper\CommonHelper;
$arr_pic = \yii\helpers\Json::decode($product['img'],true);
$pic = ArrayHelper::getValue($arr_pic,'0');
$pic = CommonHelper::getMarketPlacePic($pic);
$arn = CommonHelper::float($product['price'] * $product['creator_commission_percent'] /100);
$creator_commission_percent = CommonHelper::float($product['creator_commission_percent']);
$price = CommonHelper::float($product['price']);
$product_sales = CommonHelper::toK($product['product_sales']);
?>
<table cellpadding="0" cellspacing="0" class="es-right" align="right"
       role="none"
       style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px;float:right">
    <tbody>
    <tr>
        <td align="left" style="padding:0;Margin:0;width:270px">
            <table cellpadding="0" cellspacing="0" width="100%"
                   role="presentation"
                   style="mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;border-spacing:0px">
                <tbody>
                <tr>
                    <td align="center" style="padding:0;Margin:0;font-size:0px">
                        <a target="_blank" href="<?=$product['link']?>"
                           style="mso-line-height-rule:exactly;text-decoration:underline;color:#436E5A;font-size:14px"><img
                                    class="adapt-img p_image"
                                    src="<?=$pic?>"
                                    alt=""
                                    style="display:block;font-size:14px;border:0;outline:none;text-decoration:none"
                                    width="270"></a></td>
                </tr>
                <tr>
                    <td align="center"
                        style="Margin:0;padding-right:20px;padding-bottom:5px;padding-left:20px;padding-top:10px">
                        <p class="p_name"
                           style="    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    width: 270px;height:46px;Margin:0;mso-line-height-rule:exactly;font-family:Raleway, Arial, sans-serif;line-height:21px;letter-spacing:0;color:#666666;font-size:14px">
                            <?=$product['name']?> </p></td>
                </tr>
                <tr>
                    <td align="center"
                        style="padding:0;Margin:0;padding-right:20px;padding-left:20px;padding-bottom:10px">
                        <h3 class="p_price"
                            style="Margin:0;font-family:Marcellus, Arial, serif;mso-line-height-rule:exactly;letter-spacing:0;font-size:20px;font-style:normal;font-weight:normal;line-height:24px;color:#436E5A">
                            <?=floatval($product['creator_commission_percent'])?>%
                            <span  style="color: rgba(252, 70, 3, 1);margin-left: 5px;">
                                <?=$product_sales?> Sold
                            </span>
                        </h3></td>
                </tr>
                <tr>
                    <td align="center"
                        style="padding:0;Margin:0;padding-right:20px;padding-left:20px;padding-bottom:10px">
                        <h3 class="p_price"
                            style="color: red;Margin:0;font-family:Marcellus, Arial, serif;mso-line-height-rule:exactly;letter-spacing:0;font-size:20px;font-style:normal;font-weight:normal;line-height:24px;">
                            $<?=$arn?> Earn per sale</h3>
                    </td>

                </tr>
                <tr>
                    <td align="center"
                        style="padding:0;Margin:0;padding-right:20px;padding-left:20px;padding-bottom:30px">
                        <a href="<?=$product['link']?>" style="text-underline: none;">
                            <div style="width: 148px;">
                                <div style="line-height:30px;font-size: 12px;    border-radius: 9999px;    cursor: pointer;    position: relative;">
                                    <div style="color: #fff;    text-align: center !important;font-weight: 500;    --tw-bg-opacity: 1;background-color: #000;    border-radius: 9999px;    justify-content: center;">
                                        Get Free Sample
                                    </div>
                                </div>
                            </div>
                        </a>
                    </td>
                </tr>
                </tbody>
            </table>
        </td>
    </tr>
    </tbody>
</table>
